<!DOCTYPE html class="pixel-ratio-3 retina ios ios-11 ios-11-0 ios-gt-10 ios-gt-9 ios-gt-8 ios-gt-7 ios-gt-6">
<html>

<head>
  <title>消息</title>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

  <meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.">
  <% include  ./template/commonCss.ejs %>
  <link href="<%=resUrl%>/css/tpl_chat.css" rel="stylesheet" type="text/css" />
  <% include ./template/commonJs.ejs %>
  <script type='text/javascript' src='<%=resUrl%>/lib/hxsdk/webim.config.js'></script>
  <script type='text/javascript' src='<%=resUrl%>/lib/hxsdk/strophe-1.2.8.min.js'></script>
  <script type='text/javascript' src='<%=resUrl%>/lib/hxsdk/websdk-1.4.13.js'></script>
</head>

<body ontouchstart>
  <div id="chat">
    <!--下拉刷新-->
    <div class="weui-pull-to-refresh__layer" style="padding: 5px;">
      <div class="weui-pull-to-refresh__arrow"></div>
      <div class="weui-pull-to-refresh__preloader"></div>
      <div class="down">下拉刷新</div>
      <div class="up">释放刷新</div>
      <div class="refresh">正在刷新</div>
    </div>
    <div id="chat-list-content">
    </div>
  </div>
  <script id="chat-list" type="text/html">
    {{each list as chater index}}
      {{if chater.list[chater.list.length-1].isSender == 1}}
        <!-- 我是发送者取接收者-->
        <a href="javascript:visitUrl('/chat?charToUser={{chater.list[chater.list.length-1].accepter}}')" char="{{chater.list[chater.list.length-1].accepter}}" class="weui-media-box weui-media-box_appmsg weui-cell_swiped">
      {{else}}
        <!-- 我是接收者取发送者 -->
        <a href="javascript:visitUrl('/chat?charToUser={{chater.list[chater.list.length-1].sender}}')" char="{{chater.list[chater.list.length-1].sender}}" class="weui-media-box weui-media-box_appmsg weui-cell_swiped">
      {{/if}}
        <div class="weui-cell__bd">
          <div class="weui-media-box__hd">
            {{if chater.photo}}
              <img class="weui-media-box__thumb" src="{{chater.photo}}" alt="">
            {{else}}
              {{if chater.name == 'admin'}}
                <img class="weui-media-box__thumb" src="img/service-logo.png" alt="">
              {{else}}
                <img class="weui-media-box__thumb" src="" alt="">
              {{/if}}
            {{/if}}
            {{if chater.noReadCount > 0 }}
              <span class="weui-badge" style="position: absolute;bottom:0.35rem;right:0.6rem;">{{chater.noReadCount}}</span>
            {{/if}}
          </div>
          <div class="weui-media-box__bd">
            <h4 class="weui-media-box__title">
              {{if chater.nickName}}
                {{chater.nickName}}
              {{else}}
                {{if chater.name == 'admin'}}
                  官方信息
                {{else}}
                  {{chater.name}}
                {{/if}}
              {{/if}}
              <span class="weui-media-box__title-after">{{chater.list[chater.list.length-1].datetime}}</span>
            </h4>
            {{if chater.list[chater.list.length-1].type == 1}}
              {{if chater.list[chater.list.length-1].sourceMsg.indexOf('product:::') != -1}}
                <p class="weui-media-box__desc">[藏品]</p>
              {{else}}
                <p class="weui-media-box__desc">{{chater.list[chater.list.length-1].sourceMsg}}</p>
              {{/if}}
            {{else}}
              <p class="weui-media-box__desc">[图片]</p>
            {{/if}}
          </div>
        </div>
        <div class="weui-cell__ft">
          <div class="weui-swiped-btn weui-swiped-btn_warn delete-swipeout" href="javascript:">删除</div>
          <div class="weui-swiped-btn weui-swiped-btn_default close-swipeout" href="javascript:">关闭</div>
        </div>
      </a>
    {{/each}}
  </script>
  <% var tabbarName = "msg"; %>
  <% include ./template/tabbar.ejs %>
  <script type="text/javascript" src="<%=resUrl%>/js/tpl_chat.js"></script>
</body>

</html>